import requests
import sys

def UpFile(Url, FilePath, data):
    '''
    用于POST上传文件以及提交参数
    @ Url 上传接口
    @ FilePath 文件路径
    @ data 提交参数 {'key':'value', 'key2':'value2'}
    '''
    files = {'file': open(FilePath, 'rb')}
    result = requests.post(Url, files=files, data=data)
    return result.text

if __name__ == "__main__":
    print(UpFile(sys.argv[1],sys.argv[2],{}))
